#include <cstdio>
#include <cstring>

int main( )
{
    char s1[ 20 ], s2[ 20 ];
    int i, a[ 20 ], b[ 20 ], lena, lenb;
    while ( scanf("%s%s", &s1, &s2) != EOF )
    {
        lena = strlen( s1 ); lenb = strlen( s2 );
        for ( i = 0; i < lena; i++ )
            a[ i ] = s1[ lena - i - 1 ] - '0';
        for ( i = 0; i < lenb; i++ )
            b[ i ] = s2[ lenb - i - 1 ] - '0';
        for ( i = 0; i < lenb; i++ )
        {
            a[ i ] -= b[ i ];
            if ( a[ i ] <= 0 && i < lena - 1 )
            {    
                a[ i ] += 9;
                a[ i + 1 ]--;
            }
        }
        if ( a[ lena - 1 ] == -1 )
        {
            i = lena - 1;
            while ( a[ i ] != 9 && i >= 0 ) a[ i-- ] = 0;
            a[ i ] = 0;
        }
        while ( a[ lena - 1 ] == 0 && lena > 1 ) lena--;
        for ( i = 0; i < lena; i++ )
            if ( a[ i ] <= 0 && i < lena - 1 )
            {
                a[ i ] += 9;
                a[ i + 1 ]--;
            }
        while ( a[ lena - 1 ] == 0 && lena > 1 ) lena--;
        printf("%d", a[ lena - 1 ]);
        for ( i = lena - 2; i >= 0; i-- )
            printf("%d", a[ i ]);
        printf("\n");
    }
    return 0;
}
